package com.free.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.free.dao.Assert;
import com.free.service.UserService;
import com.free.utils.R;
/**
 * 
* @ClassName: ApiRegisterController 
* @Description: TODO(注册) 
* @author wujie
* @email 602991693@qq.com 
* @date 2017年8月31日 下午2:31:54 
*
 */
@RestController
@RequestMapping("/api")
public class ApiRegisterController {
	@Autowired
	private UserService userService;
	
	@PostMapping("register")
	public R register(String mobile,String password){
		Assert.isBlank(mobile, "手机号不能为空");
		Assert.isBlank(password, "密码不能为空");
		userService.save(mobile, password);
		return R.ok();
	}
}
